import { get,del,patch,post,put, upload } from '../../utils/request';


//获取订单列表
export function orderListApi(obj) {
    return get('/order',obj);
}
//订单详情
export function orderDetailApi(obj) {
    return get('/order/'+obj,obj);
}

//删除订单
export function delOrderApi(obj) {
    return del('/order/'+obj,obj);
}
//取消订单
export function cancleOrderApi(obj) {
    return put(`/order/${ obj.orderSn }`, obj);
}

//订单确认收货
export function finishOrderApi(obj) {
    return put('/order/finish/' + obj, obj);
}

//获取支付方式列表
export function payListApi() {
    return get('/order/payment/list');
}

//为你推荐
export function recommendsApi() {
    return get('/member/recommends');
}

//商品评价
export function EvaluateApi(obj) {
    return post('/reviews/store/evaluate',obj);
}

//FormData上传单张图片
export function upLoadApi(obj) {
    return upload('/upload',obj);
}

//订单换货
export function barterApi(obj) {
    return post('/refundreturn/barter/order',obj);
}

//订单退款
export function refundApi(obj) {
    return post('/refundreturn/refund/order',obj);
}

//订单退货
export function returnApi(obj) {
    return post('/refundreturn/return/goods/order', obj);
}

// Lz 微信H5 支付接口
export function h5WeiXin(obj) {
    return get('/wxpay/h5wxpayInfo', obj);
}
// Lz 余额 支付接口
export function YEverification(obj) {
    return post('/wxpay/pay', obj);
}
// Lz 支付宝 支付接口
export function alipayPayment(obj) {
    return get('/alipay', obj);
}

//加入购物车
export function addCartOrBuy(obj) {
    // POST /rest/api/v6.0/cart
    return post(`/cart`, obj);
}

// 换货
export function returnDetailApi(obj) {
    return get(`/refundreturn/barter/detail`, obj);
}

// 退货
export function refundDetailApi(obj) {
    console.log(obj, "退货吗。。。。。。。。。。。。。。。");
    return get(`/refundreturn/return/detail`, {refundId: obj.id});
}

// // 获取 退货数据。。。。。
// export function returnListApi(obj) {
//     return get('/refundreturn/returnList', obj);
// }
// 获取 换货数据。。。。。
export function refundListApi(obj) {
    return get('/refundreturn/barters', obj);
}

//换货列表
// export function bartersListApi(obj) {
//     return get('/refundreturn/barters', obj);
// }
//退货列表
export function returnListApi(obj) {
    return get('/refundreturn/returnList', obj);
}


// 再来一单！
export function againApi(obj) {
    return post('/cart/again', obj);
}
//追评
export function evaluateTwo(obj) {
    // GET /rest/api/v6.0/goods/evaluateDetail/{gevalId}
    return post(`goods/evaluate/${obj.id}/evaluate`, obj);
}

//换货发货接口
export function barterDeliveryApi(obj) {
    return post(`/refundreturn/barter/delivery`, obj);
}

//退货发货接口
export function returnDeliveryApi(obj) {
    return post(`/refundreturn/return/delivery`, obj);
}

//  订单确认收货
export function orderFinishApi(obj) {
    return post(`/refundreturn/barter/finish`, obj);
}

//  商品的再次购买
export function cartApi(obj) {
    return post(`/cart`, obj);
}

//更改订单配置。。。
export function barterSendApi(obj) {
    return post('/refundreturn/barter/delivery', obj);
}
